cmake_minimum_required(VERSION 2.8)
project(hdfs_demo)

set(CMAKE_CXX_STANDARD 98)

# 从环境变量中读取
set(HADOOP_HOME $ENV{HADOOP_HOME})
set(JAVA_HOME $ENV{JAVA_HOME})

# 头文件目录
INCLUDE_DIRECTORIES(${HADOOP_HOME}/include)
INCLUDE_DIRECTORIES(${JAVA_HOME}/jre/include)

#库文件目录
LINK_DIRECTORIES(${HADOOP_HOME}/lib/native/)
LINK_DIRECTORIES(${JAVA_HOME}/jre/lib/amd64/server)

link_libraries(${HADOOP_HOME}/lib/native/libhdfs.so)
link_libraries(${JAVA_HOME}/jre/lib/amd64/server/libjvm.so)

add_executable(main main.cpp)
